#! bin/bash
path=`pwd`/`dirname $0`
cd ${path}
git pull
cargo build --release
mkdir -p ../process/nrgrid
cp ./target/release/nrgrid ../process/nrgrid/nrgrid
mkdir -p ../process/nrgrid/http
cp -r ./http/ ../process/nrgrid/http/
mkdir -p ../process/nrgrid/conf
cp -r ./conf/ ../process/nrgrid/conf/
currentTime=`date +%Y%m%d%H%M%S`
cd ../process/
tar -cvf nrgrid-${currentTime}.tar nrgrid/
rm -rf ../process/nrgrid/